# -.- coding:utf-8 -.-# __author__ = 'vivi'L = ['Michael', 'Sarah', 'Tracy', 'Bab', 'Jack']print('L[0:3]=', L[0:3])print('L[:3]=', L[:3])print('L[1:3]=', L[1:3])print('L[-2]=', L[-2:])'''执行结果为：L[0:3]= ['Michael', 'Sarah', 'Tracy']L[:3]= ['Michael', 'Sarah', 'Tracy']L[1:3]= ['Sarah', 'Tracy']L[-2]= ['Bab', 'Jack']'''R = list(range(100))print('R[:10]=', R[:10])print('R[-10:]=', R[-10:])print('R[10:20]=', R[10:20])print('R[:10:2]=', R[:10:2])print('R[::5]=', R[::5])'''执行结果为：R[:10]= [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]R[-10:]= [90, 91, 92, 93, 94, 95, 96, 97, 98, 99]R[10:20]= [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]R[:10:2]= [0, 2, 4, 6, 8]R[::5]= [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95]'''